﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArmoryData.Character
{
    public class TalentSpec
    {
        public int TreeOne { get; set; }
        public int TreeTwo { get; set; }
        public int TreeThree { get; set; }
        public string Icon { get; set; }
        public string Name { get; set; }
        public bool Active { get; set; }
        public string Url { get; set; }
        public List<Glyph> Glyphs {get; set;}

        public TalentSpec()
        {
            Glyphs = new List<Glyph>();
        }

        public override string ToString()
        {
            return string.Format("{0} ({1}/{2}/{3}){4}", Name, TreeOne, TreeTwo, TreeThree, Active ? " [Active]" : "");
        }

        public int Id
        {
            get
            {
                if (TreeOne == 0 && TreeTwo == 0 && TreeThree == 0) return -1;
                int high = TreeOne;
                if (TreeTwo > high) high = TreeTwo;
                if (TreeThree > high) high = TreeThree;

                if (high == TreeOne) return 1;
                else if (high == TreeTwo) return 2;
                else if (high == TreeThree) return 3;
                else return -1;
            }
        }
    }
}
